<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"  prefix="fn"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>后台数据信息</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="shortcut icon" type="image/x-icon" href="https://wwl.ycws.cc/image/backgroundimage/e.ico">
	<!--<link rel="stylesheet" type="text/css" href="styles.css">-->
	<script src="js/jquery-1.11.3.min.js"></script>
	<script type="text/javascript">
			function disable(id,yaddress){
				//var yaddressall=$.trim($("#yaddressall").text())
				var nameif = /(?!(\D*\d){11})^[\u4e00-\u9fa5\w]{2,21}$/;
				var nuberif= /^[0-9]*$/;
				var name=document.getElementById("nn").value; //用户姓名
				var cardnumber=document.getElementById("number").value;
				var yidcarto=document.getElementById("yidcar").value;
				var num  = document.getElementById("option").value;
				var danyuanlou = document.getElementById("danyuanlou").value;
				var fanghao = document.getElementById("fanghao").value;
				var yid = id;
				var address =yaddress;
				var fanghaoyz =/^\d{2,6}$/;
				if(!nameif.test(name)){
		   	   		alert("请输入2-12位中文或者字母或者数字，总数不能超过21位（数字的个数不能超过11个,不能空白格）");
		   	  	 }else if(!nuberif.test(cardnumber)){
		   	  		alert("请输入数字型的卡号,不能空白格");
		   	  	 }else if(!fanghaoyz.test(fanghao)){
		   	  	alert("房号请输入最多6位最少2位的数字");
		   	  	 }else  {
		   	  	var paer={yid:id,ydetailed:num,yname:name,yaddress:address,cardnumber:cardnumber,yidcar:yidcarto,roomandnumber:fanghao,unitbuilding:danyuanlou};
				$.ajax({
					url:"${path}/bassm/user/upUseroneFinset",
					data:paer,
					type:"post",
					async:false,
					success:function(date){
						debugger;
						if(date.msg==1){		
							var xq=date.detailed;
							window.location.href = "${path}/bassm/user/visitorsuser2?Celladdress="+xq;
							alert("成功");
						}else if(date.msg==400){
							alert("你的卡号已经被绑定，请更换卡号");
						}else{
							alert("错误");
						}
					},
					error:function(){
						alert("异常错误，请联系供应商");
					}
				});
			};
		}
				
	</script>
<script type="text/javascript">
	function selcetuser(yaddress){
		var xq = yaddress;
		window.location.href = "${path}/bassm/user/visitorsuser2?Celladdress="+xq;
		
	}
</script>
  </head>
  <body >
	<div style="text-align: center;">
  	</div>
    <table border="1" cellpadding="0" cellspacing="0" align="center" >
    	<tr align="center" height="50" style="background-color:2082D5; color:white;">
    		
    		<td width="100">头像</td>
    		<td width="150">姓名</td>
    		<td width="100">性别</td>
    		<td width="200">手机</td>
    		<td width="200">身份证</td>
    		<td width="200">卡号</td>
    		<td width="150">小区地址</td>
    		<td width="150">楼栋</td>
    		<td width="150">单元楼</td>
    		<td width="150">房号</td>
    		<td width="150">用户状态</td>
    		<td width="100">有效时间</td>
    		<td width="250">操作</td>
    	</tr>
    	<c:forEach var="v" items="${products}">
	    	<tr align="center" style="background-color:#fafafa;">
	    			<td>
	    			<c:if test="${(v.yfilename ==null) }">
					<img alt="" src="img/a00.jpg" width="100" height="120">
					</c:if>  
					<c:if test="${(v.yfilename !=null) }">
					<img alt="" src="${v.yfilename}" width="100" height="120">
					</c:if>    			
	    			</td>
	    			<td>
	    			<input type="text"id="nn"value="${v.yname}" style="width: 100px;">
	    			</td>
	    			<td>${v.ysex}</td>
	    			<td>${v.yphone}</td>
	    			<td>
	    			<input type="text"id="yidcar"value="${v.yidcar}" style="width: 100px;">
	    			</td>
	    			<td>
	    			<input type="text"id="number"value="${v.cardnumber}" style="width: 100px;">
	    			</td>
	    			<td id="yaddressall">${v.yaddress}</td>	    			
	    			<td>
	    			<select id ="option" name="option">
	    			<%-- <option value=${v.ydetailed}>${v.ydetailed}</option> --%>
	    			<c:if test="${(v.ydetailed != '0') }">>
	    			<option value=${v.ydetailed}>${v.ydetailed}</option>
	    			</c:if>
	    			<c:if test="${(v.ydetailed == '0') }">>
	    			<option value=${v.ydetailed}>全部</option>
	    			</c:if>
	    			<c:forEach var="u" items="${unitdoor}">
	    			<option value=${u.number}>${u.number}</option>  
	    			</c:forEach>
	    			</select>
	    			</td>
	    			<td>
	    			<input type="text"id="danyuanlou"value="${v.unitbuilding}" style="width: 100px;">
	    			</td>
	    			<td><input type="text"id="fanghao"value="${v.roomandnumber}" style="width: 100px;">
	    			</td>  			
    				<td>
	    				<c:if test="${fn:contains(v.examine,'1') }">
        					<img alt="" src="img/15.jpg">
        				</c:if>
        				<c:if test="${fn:contains(v.examine,'0') }">
        					<img alt="" src="img/14.jpg">
        				</c:if>
        				<c:if test="${fn:contains(v.examine,'2') }">
        					图片审核失败
        				</c:if>
        				<c:if test="${fn:contains(v.examine,'3') }">
        					图片审核中
        				</c:if>
	    			</td>
	    			<td>${v.idnumber}</td>	
	    			<td>
	    				<input type="button"	 onclick="disable(${v.yid},'${v.yaddress}')" id="addbmd" value="保存" style="width: 40px; height: 33px; background-color: #2082D5;color: white;">	    					    			
    					<input type="button" id="selcetuser"  onclick="selcetuser('${v.yaddress}')" value="返回" style="width: 40px; height: 33px; background-color: #2082D5;color: white;">
	    				
	    			</td>
	    	</tr>
	    	
    	</c:forEach>
    </table>
  </body>
</html>
